{t("Jellyfin Year Review")} touch = null} />
{#if user}
{t("J")}{t("Jellyfin")} {t("Year Review")}{t("A YEAR WORTH REPLAYING")} {#if user} {/if}
{/if}
{#if user} {#if notice}

{notice}

{/if} {#if error}{/if} {/if} {#if !user} {:else if loading}

{t("Setting the scene…")}

{t("Loading your private review")}

{:else if !years.length}

{t("NOT QUITE SHOWTIME")}

{t("Your story is on its way.")}

{t("No review has been generated for your account. Ask your server operator to generate a year.")}

{:else if review}
{review.year} / {user.name}
{#key card}

{t("CHAPTER {number} / {name}", { number: String(slide + 1).padStart(2, '0'), name: cards[slide].name.toLocaleUpperCase(locale) })}

{#if card === 0} {review.year}

{t("Your viewing recap")}

{t(review.records ? "{name}, see the movies, TV shows, and viewing habits that made up your year." : "{name}, no viewing activity was recorded for this year.", { name: user.name })}

{:else if card === 1}

{t("Your watch time")}

{hours(review.seconds)}{t(review.availability.exactWatchTime.available ? "hours watched" : "hours watched · end-attributed estimate")}
{duration(review.movieSeconds)}{t("Movies")}
{duration(review.tvSeconds)}{t("Television")}
{count(review.records)}{t("Activity records")}
{count(review.uniqueTitles)}{t("Unique movies & episodes")}
{:else if card === 2 || card === 3} {@const items = card === 2 ? review.movies : review.shows}

{card === 2 ? t("Movies watched") : t("TV shows watched")}

{t("Everything you watched in {year}, grouped by month.", { year: review.year })}

{:else if card === 4}

{t("Unfinished movies")}

{t("Movies where you watched less than {percent}% of the runtime.", { percent: review.rules.completionPercent })}

{#if review.abandoned.length}
    {#each review.abandoned.slice(0, 5) as item}
  1. {item.title}

    {t("{percent}% of the movie watched", { percent: Math.round(item.completionPercent) })}

  2. {/each}
{:else}

{review.availability.completion.available ? t("No unfinished movies found in supported records.") : t("Completion is unavailable without runtime and actual position ranges.")}

{/if} {:else if card === 14}

{t("Shows you've watched are from platforms...")}

{t("Distinct TV shows watched, grouped by platform.")}

{:else if card === 5}

{t("Your top genres")}

{t("Genres ranked by watch time.")}

{#if review.genres.length} {@const values = review.genres.slice(0, 7).map(v => v.seconds / 3600)} {@const labels = review.genres.slice(0, 7).map(v => message(v.name))} {:else}

{t("No genre history is available.")}

{/if} {:else if card === 6}

{t("Viewing by hour")}

{t("Your viewing activity across the hours of the day.")}

`${String(i).padStart(2, '0')}:00`)} metric={review.distributionMetric === 'watched minutes' ? t("min") : t("records")} />
{:else if card === 7}

{t("Viewing by weekday")}

{t("Your viewing activity for each day of the week.")}

{:else if card === 8}

{t("Viewing by month")}

{t("Your viewing activity for each month of {year}.", { year: review.year })}

{:else if card === 9}

{t("Your devices and apps")}

{t("Your most-used devices and apps, ranked by watch time.")}

{t("Devices")}

v.seconds / 3600)} labels={review.devices.slice(0, 5).map(v => message(v.name))} metric={t("h")} />

{t("Apps & clients")}

v.seconds / 3600)} labels={review.clients.slice(0, 5).map(v => message(v.name))} metric={t("h")} />
{:else if card === 10}

{t("Your longest viewing session")}

{#if review.marathon}
{hours(review.marathon.watchedSeconds)}{t("hours watched in your longest session")}

{t("{duration} elapsed · {records} records", { duration: duration(review.marathon.elapsedSeconds), records: count(review.marathon.records) })}

{new Date(review.marathon.start).toLocaleString(locale, { timeZone: review.timezone })}

{:else}

{message(review.availability.marathon.reason)}

{/if} {:else if card === 11}

{t("Your viewing profile")}

{#if review.personality}

{message(review.personality.name)}

{message(review.personality.explanation)}

{:else}

{message(review.availability.personality.reason)}

{/if} {:else if card === 12}

{t("It's not a competition...")}{' '}{t("but this is your watch-time ranking")}

{#if review.ranking}
#{review.ranking.rank}{t("of {count} eligible viewers", { count: count(review.ranking.cohort) })}
{hours(review.seconds)} {t("h")}{t("Your total hours watched · movies & TV shows")}
{Math.round(review.ranking.percentile)}%{t("Viewers with less watch time")}
{:else}

{message(review.availability.ranking.reason)}

{/if} {:else}

{t("SUMMARY / {year}", { year: review.year })}

{t("Your year in summary")}

{#if review.availability.exactWatchTime.available !== false}
{duration(review.seconds)}{t("Your watch time")}
{/if}{#if review.availability.personality.available !== false}
{message(review.personality?.name) || t("No viewing profile")}{t("Your viewing profile")}
{/if}

{t("You have reached the end of your viewing recap.")}

{/if}
{/key}
{String(slide + 1).padStart(2, '0')} / {cards.length}
{t("Behind your review · source & availability")}

{message(review.source)}

{message(review.coverage)}

{t("Snapshot: {date} · Format v{version}", { date: new Date(review.generatedAt).toISOString(), version: review.schemaVersion })}

{#each review.warnings as warning}

{message(warning)}

{/each}
{:else}

{t("Let’s try that again.")}

{/if}
{#if user}
{t("MADE FOR THE LOVE OF THE WATCH.")}
{/if}
{#if user && !loading && review?.ranking && card === 12}{/if}